package com.example.object.screen;

import android.content.Context;
import android.util.Log;

import com.example.globject.GLSquare;
import com.example.object.GameShape;

/**
 * Created by Lucas on 06/06/13.
 */
public class BallShape extends GameShape {

    /**
     * The gl object of the ball
     */
    private GLSquare _glSquare;
    /**
     * The debug TAG
     */
    private final String TAG = "BallShape";

    /**
     * The constructor
     * @param context the context of the application
     * @param xBottomLeft the x origin coordinate of the ball
     * @param yBottomLeft the y origin coordinate of the ball
     * @param height the height of the ball
     * @param width the width of the ball
     * @param texture the id of the texture of the ball
     */
    public BallShape(Context context, float xBottomLeft, float yBottomLeft,
                     float height, float width, int texture){

        Log.i(TAG, "SignShape constructor");
        _handlerInitiate = false;
        _userData = -1;
        _glSquare = new GLSquare(context, xBottomLeft, yBottomLeft, height, width, texture);

    }

    /**
     * Set the matrix and other id of the resources
     * @param positionHandle
     * @param textureHandle
     * @param MVPMatrixHandle
     * @param vMatrix
     * @param projMatrix
     */
    public void setGLHandler(int positionHandle, int textureHandle, int MVPMatrixHandle,
                             float vMatrix[], float projMatrix[]){
        _glSquare.setGLHandler(positionHandle,textureHandle,MVPMatrixHandle,vMatrix,projMatrix, null);
        _handlerInitiate = true;

    }

    /**
     * Draw the ball object
     */
    @Override
    public void draw(){
        _glSquare.draw();
    }

    public String toString(){
        return "\n glSquare: " + _glSquare.toString();
    }


    public GLSquare getGLSquare(){
        return _glSquare;
    }

    public void calculateNextCoordinate() {
        // do nothing
    }
}
